
	package com.icss.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

@Configuration
@ComponentScan("com.icss.dao.redis")
public class RedisConfig {
	@Bean
	public JedisPoolConfig poolConfig(){
		JedisPoolConfig cfg=new JedisPoolConfig();
		cfg.setMaxTotal(1000);
		cfg.setMaxIdle(1000);
		cfg.setTestOnBorrow(true);
		return cfg;
	}
	@Bean
	public JedisPool jedisPool(){
		JedisPool pool=new JedisPool(this.poolConfig(), "localhost");
		return pool;
	}
}
